<template>
	<view class="">
		<uni-icons fontFamily="iconfont" @tap="switchIcon" :size="size"
			:color="color || colors[Number(flag)]">{{icons[Number(flag)]}}</uni-icons>
	</view>
</template>

<script>
	export default {
		props: {
			icons: {
				type: Array,
				default: () => []
			},
			color: {
				type: String,
				default: ""
			},
			size: {
				type: Number,
				default: 20
			},
			colors: {
				type: Array,
				default: () => []
			},
			flag: {
				type: Boolean,
				default: true
			}
		},
		data() {
			return {}
		},
		created() {
			
		},
		methods: {
			switchIcon() {
				console.log(11111)
				this.$emit("change", !this.flag)
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "@/static/iconfont/iconfont.css";
</style>